//*********************************************************************************************************************
//  All Winner Tech, All Right Reserved. 2014-2015 Copyright (c)
//
//  File name   :	de_vep_table.c
//
//  Description :	display engine 2.0 video enhancement processor common fir table coefficients
//
//  History     :	2014/03/28  iptang  v0.1  Initial version
//
//*********************************************************************************************************************
#include "de_vep_table.h"

int y2r[192]=
{
	//bt601
	0x000012A0,0x0,0x00000000,0x0,0x00001989,0x0,0xFFF21168,0xFFFFFFFF,0x000012A0,0x0,0xFFFFF9BE,0xFFFFFFFF,0xFFFFF2FE,0xFFFFFFFF,0x000877CF,0x0,
	0x000012A0,0x0,0x0000204A,0x0,0x00000000,0x0,0xFFEEB127,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//bt709
	0x000012A0,0x0,0x00000000,0x0,0x00001CB0,0x0,0xFFF07DF4,0xFFFFFFFF,0x000012A0,0x0,0xfffffC98,0xFFFFFFFF,0xfffff775,0xFFFFFFFF,0x0004CFDF,0x0,
	0x000012A0,0x0,0x000021D7,0x0,0x00000000,0x0,0xFFEDEA7F,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//ycc
	0x00001000,0x0,0x00000000,0x0,0x0000166F,0x0,0xFFF4C84B,0xFFFFFFFF,0x00001000,0x0,0xFFFFFA78,0xFFFFFFFF,0xFFFFF491,0xFFFFFFFF,0x00087B16,0x0,
	0x00001000,0x0,0x00001C56,0x0,0x00000000,0x0,0xFFF1D4FE,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//ehance
	0x00001000,0x0,0x00000000,0x0,0x00001933,0x0,0xFFF36666,0xFFFFFFFF,0x00001000,0x0,0xFFFFFD02,0xFFFFFFFF,0xFFFFF883,0xFFFFFFFF,0x00053D71,0x0,
	0x00001000,0x0,0x00001DB2,0x0,0x00000000,0x0,0xFFF126E9,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//bt601 studio
	0x00001000,0x0,0x00000000,0x0,0x000015F0,0x0,0xFFF50831,0xFFFFFFFF,0x00001000,0x0,0xFFFFFAA0,0xFFFFFFFF,0xFFFFF4FA,0xFFFFFFFF,0x00083333,0x0,
	0x00001000,0x0,0x00001BB6,0x0,0x00000000,0x0,0xFFF224DD,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//bt709 studio
	0x00001000,0x0,0x00000000,0x0,0x000018A4,0x0,0xFFF3AE14,0xFFFFFFFF,0x00001000,0x0,0xFFFFFD12,0xFFFFFFFF,0xFFFFF8A8,0xFFFFFFFF,0x000522D1,0x0,
	0x00001000,0x0,0x00001D0E,0x0,0x00000000,0x0,0xFFF178D5,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

};

int r2y[128]=
{
	//bt601
	0x0000041D,0x0,0x00000810,0x0,0x00000191,0x0,0x00010000,0x0,0xFFFFFDA2,0xFFFFFFFF,0xFFFFFB58,0xFFFFFFFF,0x00000706,0x0,0x00080000,0x0,
	0x00000706,0x0,0xFFFFFA1D,0xFFFFFFFF,0xFFFFFEDD,0xFFFFFFFF,0x00080000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//bt709
	0x000002EE,0x0,0x000009D3,0x0,0x000000FE,0x0,0x00010000,0x0,0xfffffe62,0xFFFFFFFF,0xfffffA98,0xFFFFFFFF,0x00000706,0x0,0x00080000,0x0,
	0x00000706,0x0,0xfffff99E,0xFFFFFFFF,0xffffff5C,0xFFFFFFFF,0x00080000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//ycc
	0x000004C8,0x0,0x00000963,0x0,0x000001D5,0x0,0x00000000,0x0,0xFFFFFD4D,0xFFFFFFFF,0xFFFFFAB3,0xFFFFFFFF,0x00000800,0x0,0x00080000,0x0,
	0x00000800,0x0,0xFFFFF94F,0xFFFFFFFF,0xFFFFFEB2,0xFFFFFFFF,0x00080000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//ehance
	0x00000368,0x0,0x00000B71,0x0,0x00000127,0x0,0x00000000,0x0,0xFFFFFE29,0xFFFFFFFF,0xFFFFF9D7,0xFFFFFFFF,0x00000800,0x0,0x00080000,0x0,
	0x00000800,0x0,0xFFFFF8BC,0xFFFFFFFF,0xFFFFFF44,0xFFFFFFFF,0x00080000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,
};

int y2y[64]=
{
	//bt601 to bt709
	0x00001000,0x0,0xFFFFFE27,0xFFFFFFFF,0xFFFFFCAC,0xFFFFFFFF,0x00029681,0x0,0x00000000,0x0,0x0000104C,0x0,0x000001D5,0x0,0xFFFEEF17,0xFFFFFFFF,
	0x00000000,0x0,0x00000133,0x0,0x00001068,0x0,0xFFFF326E,0xFFFFFFFF,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,

	//bt709 to bt601
	0x00001000,0x0,0x00000197,0x0,0x00000311,0x0,0xFFFDAC02,0xFFFFFFFF,0x00000000,0x0,0x00000FD6,0x0,0xFFFFFE3B,0xFFFFFFFF,0x0000F765,0x0,
	0x00000000,0x0,0xFFFFFED7,0xFFFFFFFF,0x00000FBC,0x0,0x0000B663,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,
};

int r2r[32] =
{
	//0-255 to 16-235
	0x00000DC0,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000DC0,0x0,0x00000000,0x0,0x00000000,0x0,
	0x00000000,0x0,0x00000000,0x0,0x00000DC0,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00000000,0x0,0x00001000,0x0,
};

int bypass_csc[12] =
{
	0x00000400,0x00000000,0x00000000,0x00000000,0x00000000,0x00000400,0x00000000,0x00000000,
	0x00000000,0x00000000,0x00000400,0x00000000,
};

unsigned int sin_cos[128] = {
	//sin table
	0xffffffbd,0xffffffbf,0xffffffc1,0xffffffc2,0xffffffc4,0xffffffc6,0xffffffc8,0xffffffca,
	0xffffffcc,0xffffffce,0xffffffd1,0xffffffd3,0xffffffd5,0xffffffd7,0xffffffd9,0xffffffdb,
	0xffffffdd,0xffffffdf,0xffffffe2,0xffffffe4,0xffffffe6,0xffffffe8,0xffffffea,0xffffffec,
	0xffffffef,0xfffffff1,0xfffffff3,0xfffffff5,0xfffffff8,0xfffffffa,0xfffffffc,0xfffffffe,
	0x00000000,0x00000002,0x00000004,0x00000006,0x00000008,0x0000000b,0x0000000d,0x0000000f,
	0x00000011,0x00000014,0x00000016,0x00000018,0x0000001a,0x0000001c,0x0000001e,0x00000021,
	0x00000023,0x00000025,0x00000027,0x00000029,0x0000002b,0x0000002d,0x0000002f,0x00000032,
	0x00000034,0x00000036,0x00000038,0x0000003a,0x0000003c,0x0000003e,0x0000003f,0x00000041,
	//cos table
	0x0000006c,0x0000006d,0x0000006e,0x0000006f,0x00000071,0x00000072,0x00000073,0x00000074,
	0x00000074,0x00000075,0x00000076,0x00000077,0x00000078,0x00000079,0x00000079,0x0000007a,
	0x0000007b,0x0000007b,0x0000007c,0x0000007c,0x0000007d,0x0000007d,0x0000007e,0x0000007e,
	0x0000007e,0x0000007f,0x0000007f,0x0000007f,0x0000007f,0x0000007f,0x0000007f,0x0000007f,
	0x00000080,0x0000007f,0x0000007f,0x0000007f,0x0000007f,0x0000007f,0x0000007f,0x0000007f,
	0x0000007e,0x0000007e,0x0000007e,0x0000007d,0x0000007d,0x0000007c,0x0000007c,0x0000007b,
	0x0000007b,0x0000007a,0x00000079,0x00000079,0x00000078,0x00000077,0x00000076,0x00000075,
	0x00000074,0x00000074,0x00000073,0x00000072,0x00000071,0x0000006f,0x0000006e,0x0000006d
};

int fcc_range_gain[6]=
{
	0x01550eaa,0x07050333,0x0bdd084f,0x0a000705,
	0x0eaa0bdd,0x03330155
};
